package 第0步;

/**
 * @ClassName : WorkCount
 * @Author : 随
 * @Date: 2021/9/14 12:06
 * @Description :
 */
import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Arrays;

public class WorkCount {

    public static void main(String[] args) throws IOException {
        FileReader fileReader = new FileReader(new File("C:\\Users\\随\\Desktop\\s.txt"));

        int[] counts = new int[52];
        char[] buf = new char[1024];
        int length = -1;

        length = fileReader.read(buf);

        for(int i =0;i< length;i++)
        {
            if(buf[i]>='A' && buf[i]<='Z'){
                counts[buf[i]-65] += 1;
            }else if(buf[i] >= 'a' && buf[i] <= 'z'){
                counts[buf[i]-71] +=1;
            }
        }

        System.out.println(Arrays.toString(counts));

        fileReader.close();
    }

}
